

<!DOCTYPE html>
<html class="writer-html5" lang="en" >
<head>
  <meta charset="utf-8" />
  
  <meta name="viewport" content="width=device-width, initial-scale=1.0" />
  
  <title>CephFS 管理命令 &mdash; Ceph Documentation</title>
  

  
  <link rel="stylesheet" href="../../_static/ceph.css" type="text/css" />
  <link rel="stylesheet" href="../../_static/pygments.css" type="text/css" />
  <link rel="stylesheet" href="../../_static/graphviz.css" type="text/css" />
  <link rel="stylesheet" href="../../_static/css/custom.css" type="text/css" />

  
  
    <link rel="shortcut icon" href="../../_static/favicon.ico"/>
  

  
  

  

  
  <!--[if lt IE 9]>
    <script src="../../_static/js/html5shiv.min.js"></script>
  <![endif]-->
  
    
      <script type="text/javascript" id="documentation_options" data-url_root="../../" src="../../_static/documentation_options.js"></script>
        <script src="../../_static/jquery.js"></script>
        <script src="../../_static/underscore.js"></script>
        <script src="../../_static/doctools.js"></script>
    
    <script type="text/javascript" src="../../_static/js/theme.js"></script>

    
    <link rel="index" title="Index" href="../../genindex/" />
    <link rel="search" title="Search" href="../../search/" />
    <link rel="next" title="Multiple Ceph File Systems" href="../multifs/" />
    <link rel="prev" title="创建 Ceph 文件系统" href="../createfs/" /> 
</head>

<body class="wy-body-for-nav">

   
  <header class="top-bar">
    

















<div role="navigation" aria-label="breadcrumbs navigation">

  <ul class="wy-breadcrumbs">
    
      <li><a href="../../" class="icon icon-home"></a> &raquo;</li>
        
          <li><a href="../">Ceph 文件系统</a> &raquo;</li>
        
      <li>CephFS 管理命令</li>
    
    
      <li class="wy-breadcrumbs-aside">
        
          
            <a href="../../_sources/cephfs/administration.rst.txt" rel="nofollow"> View page source</a>
          
        
      </li>
    
  </ul>

  
  <hr/>
</div>
  </header>
  <div class="wy-grid-for-nav">
    
    <nav data-toggle="wy-nav-shift" class="wy-nav-side">
      <div class="wy-side-scroll">
        <div class="wy-side-nav-search"  style="background: #eee" >
          

          
            <a href="../../">
          

          
            
            <img src="../../_static/logo.png" class="logo" alt="Logo"/>
          
          </a>

          

          
<div role="search">
  <form id="rtd-search-form" class="wy-form" action="../../search/" method="get">
    <input type="text" name="q" placeholder="Search docs" />
    <input type="hidden" name="check_keywords" value="yes" />
    <input type="hidden" name="area" value="default" />
  </form>
</div>

          
        </div>

        
        <div class="wy-menu wy-menu-vertical" data-spy="affix" role="navigation" aria-label="main navigation">
          
            
            
              
            
            
              <ul class="current">
<li class="toctree-l1"><a class="reference internal" href="../../start/intro/">Ceph 简介</a></li>
<li class="toctree-l1"><a class="reference internal" href="../../install/">安装 Ceph</a></li>
<li class="toctree-l1"><a class="reference internal" href="../../cephadm/">Cephadm</a></li>
<li class="toctree-l1"><a class="reference internal" href="../../rados/">Ceph 存储集群</a></li>
<li class="toctree-l1 current"><a class="reference internal" href="../">Ceph 文件系统</a><ul class="current">
<li class="toctree-l2"><a class="reference internal" href="../#cephfs">CephFS 入门</a></li>
<li class="toctree-l2 current"><a class="reference internal" href="../#id4">管理</a><ul class="current">
<li class="toctree-l3"><a class="reference internal" href="../createfs/"> 创建 CephFS 文件系统</a></li>
<li class="toctree-l3 current"><a class="current reference internal" href="#"> 管理命令</a><ul>
<li class="toctree-l4"><a class="reference internal" href="#id1">文件系统管理</a></li>
<li class="toctree-l4"><a class="reference internal" href="#id2">可配置选项</a></li>
<li class="toctree-l4"><a class="reference internal" href="#id3">最大文件尺寸以及性能</a></li>
<li class="toctree-l4"><a class="reference internal" href="#id4">关闭集群</a></li>
<li class="toctree-l4"><a class="reference internal" href="#id5">快速关闭集群以进行反删除或灾难恢复</a></li>
<li class="toctree-l4"><a class="reference internal" href="#id6">守护进程管理</a></li>
<li class="toctree-l4"><a class="reference internal" href="#id7">客户端必须具备的功能</a></li>
<li class="toctree-l4"><a class="reference internal" href="#id8">全局配置选项</a></li>
<li class="toctree-l4"><a class="reference internal" href="#advanced-cephfs-admin-settings">高级选项</a></li>
</ul>
</li>
<li class="toctree-l3"><a class="reference internal" href="../multifs/"> 创建多个文件系统</a></li>
<li class="toctree-l3"><a class="reference internal" href="../add-remove-mds/"> 配备、增加、删除 MDS</a></li>
<li class="toctree-l3"><a class="reference internal" href="../standby/">术语</a></li>
<li class="toctree-l3"><a class="reference internal" href="../standby/#mds">MDS 守护进程的引用</a></li>
<li class="toctree-l3"><a class="reference internal" href="../standby/#id3">故障切换的管理</a></li>
<li class="toctree-l3"><a class="reference internal" href="../standby/#mds-standby-replay">热备的配置</a></li>
<li class="toctree-l3"><a class="reference internal" href="../standby/#mds-join-fs">配置 MDS 与文件系统的亲和性</a></li>
<li class="toctree-l3"><a class="reference internal" href="../cache-configuration/"> MDS 缓存配置</a></li>
<li class="toctree-l3"><a class="reference internal" href="../mds-config-ref/"> MDS 配置选项</a></li>
<li class="toctree-l3"><a class="reference internal" href="../../man/8/ceph-mds/"> ceph-mds 手册页</a></li>
<li class="toctree-l3"><a class="reference internal" href="../nfs/"> 通过 NFS 导出</a></li>
<li class="toctree-l3"><a class="reference internal" href="../app-best-practices/"> 应用最佳实践</a></li>
<li class="toctree-l3"><a class="reference internal" href="../fs-volumes/"> FS 卷和子卷</a></li>
<li class="toctree-l3"><a class="reference internal" href="../quota/"> CephFS 配额管理</a></li>
<li class="toctree-l3"><a class="reference internal" href="../health-messages/"> 健康消息</a></li>
<li class="toctree-l3"><a class="reference internal" href="../upgrading/">升级 MDS 集群</a></li>
<li class="toctree-l3"><a class="reference internal" href="../upgrading/#firefly-jewel">升级比 Firefly 老的文件系统，需过 Jewel 这个槛</a></li>
<li class="toctree-l3"><a class="reference internal" href="../cephfs-top/"> CephFS Top 工具</a></li>
<li class="toctree-l3"><a class="reference internal" href="../snap-schedule/"> 定时快照</a></li>
<li class="toctree-l3"><a class="reference internal" href="../cephfs-mirroring/"> CephFS 快照镜像</a></li>
</ul>
</li>
<li class="toctree-l2"><a class="reference internal" href="../#id5">挂载 CephFS</a></li>
<li class="toctree-l2"><a class="reference internal" href="../#id6">CephFS 内幕</a></li>
<li class="toctree-l2"><a class="reference internal" href="../#id7">故障排除和灾难恢复</a></li>
<li class="toctree-l2"><a class="reference internal" href="../#id9">更多细节</a></li>
</ul>
</li>
<li class="toctree-l1"><a class="reference internal" href="../../rbd/">Ceph 块设备</a></li>
<li class="toctree-l1"><a class="reference internal" href="../../radosgw/">Ceph 对象网关</a></li>
<li class="toctree-l1"><a class="reference internal" href="../../mgr/">Ceph 管理器守护进程</a></li>
<li class="toctree-l1"><a class="reference internal" href="../../mgr/dashboard/">Ceph 仪表盘</a></li>
<li class="toctree-l1"><a class="reference internal" href="../../api/">API 文档</a></li>
<li class="toctree-l1"><a class="reference internal" href="../../architecture/">体系结构</a></li>
<li class="toctree-l1"><a class="reference internal" href="../../dev/developer_guide/">开发者指南</a></li>
<li class="toctree-l1"><a class="reference internal" href="../../dev/internals/">Ceph 内幕</a></li>
<li class="toctree-l1"><a class="reference internal" href="../../governance/">项目管理</a></li>
<li class="toctree-l1"><a class="reference internal" href="../../foundation/">Ceph 基金会</a></li>
<li class="toctree-l1"><a class="reference internal" href="../../ceph-volume/">ceph-volume</a></li>
<li class="toctree-l1"><a class="reference internal" href="../../releases/general/">Ceph 版本（总目录）</a></li>
<li class="toctree-l1"><a class="reference internal" href="../../releases/">Ceph 版本（索引）</a></li>
<li class="toctree-l1"><a class="reference internal" href="../../security/">Security</a></li>
<li class="toctree-l1"><a class="reference internal" href="../../glossary/">Ceph 术语</a></li>
<li class="toctree-l1"><a class="reference internal" href="../../jaegertracing/">Tracing</a></li>
<li class="toctree-l1"><a class="reference internal" href="../../translation_cn/">中文版翻译资源</a></li>
</ul>

            
          
        </div>
        
      </div>
    </nav>

    <section data-toggle="wy-nav-shift" class="wy-nav-content-wrap">

      
      <nav class="wy-nav-top" aria-label="top navigation">
        
          <i data-toggle="wy-nav-top" class="fa fa-bars"></i>
          <a href="../../">Ceph</a>
        
      </nav>


      <div class="wy-nav-content">
        
        <div class="rst-content">
        
          <div role="main" class="document" itemscope="itemscope" itemtype="http://schema.org/Article">
           <div itemprop="articleBody">
            
<div id="dev-warning" class="admonition note">
  <p class="first admonition-title">Notice</p>
  <p class="last">This document is for a development version of Ceph.</p>
</div>
  <div id="docubetter" align="right" style="padding: 5px; font-weight: bold;">
    <a href="https://pad.ceph.com/p/Report_Documentation_Bugs">Report a Documentation Bug</a>
  </div>

  
  <div class="section" id="cephfs">
<span id="cephfs-administration"></span><h1>CephFS 管理命令<a class="headerlink" href="#cephfs" title="Permalink to this headline">¶</a></h1>
<div class="section" id="id1">
<h2>文件系统管理<a class="headerlink" href="#id1" title="Permalink to this headline">¶</a></h2>
<div class="admonition note">
<p class="admonition-title">Note</p>
<p>文件系统、元数据存储池、和数据存储池的名字只能由这些字符 [a-zA-Z0-9_-.] 组成。</p>
</div>
<p>这些命令适用于 Ceph 集群的 CephFS 文件系统。注意，默认情况下，只允许一个文件系统；执行 <code class="docutils literal notranslate"><span class="pre">ceph</span> <span class="pre">fs</span> <span class="pre">flag</span> <span class="pre">set</span> <span class="pre">enable_multiple</span> <span class="pre">true</span></code>
后才允许创建多个文件系统。</p>
<div class="highlight-default notranslate"><div class="highlight"><pre><span></span><span class="n">fs</span> <span class="n">new</span> <span class="o">&lt;</span><span class="n">file</span> <span class="n">system</span> <span class="n">name</span><span class="o">&gt;</span> <span class="o">&lt;</span><span class="n">metadata</span> <span class="n">pool</span> <span class="n">name</span><span class="o">&gt;</span> <span class="o">&lt;</span><span class="n">data</span> <span class="n">pool</span> <span class="n">name</span><span class="o">&gt;</span>
</pre></div>
</div>
<p>This command creates a new file system. The file system name and metadata pool
name are self-explanatory. The specified data pool is the default data pool and
cannot be changed once set. Each file system has its own set of MDS daemons
assigned to ranks so ensure that you have sufficient standby daemons available
to accommodate the new file system.</p>
<div class="highlight-default notranslate"><div class="highlight"><pre><span></span><span class="n">fs</span> <span class="n">ls</span>
</pre></div>
</div>
<p>按名字罗列所有文件系统。</p>
<div class="highlight-default notranslate"><div class="highlight"><pre><span></span><span class="n">fs</span> <span class="n">lsflags</span> <span class="o">&lt;</span><span class="n">file</span> <span class="n">system</span> <span class="n">name</span><span class="o">&gt;</span>
</pre></div>
</div>
<p>罗列一个文件系统上设置的所有标志。</p>
<div class="highlight-default notranslate"><div class="highlight"><pre><span></span><span class="n">fs</span> <span class="n">dump</span> <span class="p">[</span><span class="n">epoch</span><span class="p">]</span>
</pre></div>
</div>
<p>This dumps the FSMap at the given epoch (default: current) which includes all
file system settings, MDS daemons and the ranks they hold, and the list of
standby MDS daemons.</p>
<div class="highlight-default notranslate"><div class="highlight"><pre><span></span><span class="n">fs</span> <span class="n">rm</span> <span class="o">&lt;</span><span class="n">file</span> <span class="n">system</span> <span class="n">name</span><span class="o">&gt;</span> <span class="p">[</span><span class="o">--</span><span class="n">yes</span><span class="o">-</span><span class="n">i</span><span class="o">-</span><span class="n">really</span><span class="o">-</span><span class="n">mean</span><span class="o">-</span><span class="n">it</span><span class="p">]</span>
</pre></div>
</div>
<p>Destroy a CephFS file system. This wipes information about the state of the
file system from the FSMap. The metadata pool and data pools are untouched and
must be destroyed separately.</p>
<div class="highlight-default notranslate"><div class="highlight"><pre><span></span><span class="n">fs</span> <span class="n">get</span> <span class="o">&lt;</span><span class="n">file</span> <span class="n">system</span> <span class="n">name</span><span class="o">&gt;</span>
</pre></div>
</div>
<p>Get information about the named file system, including settings and ranks. This
is a subset of the same information from the <code class="docutils literal notranslate"><span class="pre">fs</span> <span class="pre">dump</span></code> command.</p>
<div class="highlight-default notranslate"><div class="highlight"><pre><span></span><span class="n">fs</span> <span class="nb">set</span> <span class="o">&lt;</span><span class="n">file</span> <span class="n">system</span> <span class="n">name</span><span class="o">&gt;</span> <span class="o">&lt;</span><span class="n">var</span><span class="o">&gt;</span> <span class="o">&lt;</span><span class="n">val</span><span class="o">&gt;</span>
</pre></div>
</div>
<p>Change a setting on a file system. These settings are specific to the named
file system and do not affect other file systems.</p>
<div class="highlight-default notranslate"><div class="highlight"><pre><span></span><span class="n">fs</span> <span class="n">add_data_pool</span> <span class="o">&lt;</span><span class="n">file</span> <span class="n">system</span> <span class="n">name</span><span class="o">&gt;</span> <span class="o">&lt;</span><span class="n">pool</span> <span class="n">name</span><span class="o">/</span><span class="nb">id</span><span class="o">&gt;</span>
</pre></div>
</div>
<p>Add a data pool to the file system. This pool can be used for file layouts
as an alternate location to store file data.</p>
<div class="highlight-default notranslate"><div class="highlight"><pre><span></span><span class="n">fs</span> <span class="n">rm_data_pool</span> <span class="o">&lt;</span><span class="n">file</span> <span class="n">system</span> <span class="n">name</span><span class="o">&gt;</span> <span class="o">&lt;</span><span class="n">pool</span> <span class="n">name</span><span class="o">/</span><span class="nb">id</span><span class="o">&gt;</span>
</pre></div>
</div>
<p>This command removes the specified pool from the list of data pools for the
file system.  If any files have layouts for the removed data pool, the file
data will become unavailable. The default data pool (when creating the file
system) cannot be removed.</p>
<div class="highlight-default notranslate"><div class="highlight"><pre><span></span><span class="n">fs</span> <span class="n">rename</span> <span class="o">&lt;</span><span class="n">file</span> <span class="n">system</span> <span class="n">name</span><span class="o">&gt;</span> <span class="o">&lt;</span><span class="n">new</span> <span class="n">file</span> <span class="n">system</span> <span class="n">name</span><span class="o">&gt;</span> <span class="p">[</span><span class="o">--</span><span class="n">yes</span><span class="o">-</span><span class="n">i</span><span class="o">-</span><span class="n">really</span><span class="o">-</span><span class="n">mean</span><span class="o">-</span><span class="n">it</span><span class="p">]</span>
</pre></div>
</div>
<p>Rename a Ceph file system. This also changes the application tags on the data
pools and metadata pool of the file system to the new file system name.
The CephX IDs authorized to the old file system name need to be reauthorized
to the new name. Any on-going operations of the clients using these IDs may be
disrupted. Mirroring is expected to be disabled on the file system.</p>
</div>
<div class="section" id="id2">
<h2>可配置选项<a class="headerlink" href="#id2" title="Permalink to this headline">¶</a></h2>
<div class="highlight-default notranslate"><div class="highlight"><pre><span></span><span class="n">fs</span> <span class="nb">set</span> <span class="o">&lt;</span><span class="n">fs</span> <span class="n">name</span><span class="o">&gt;</span> <span class="n">max_file_size</span> <span class="o">&lt;</span><span class="n">size</span> <span class="ow">in</span> <span class="nb">bytes</span><span class="o">&gt;</span>
</pre></div>
</div>
<p>CephFS 允许的最大文件尺寸是可以配置的，默认是 1TB 。如果你想在
CephFS 里存储大文件，也许得把这个限量设置得高些。它是个 64 位的字段。</p>
<p>把 <code class="docutils literal notranslate"><span class="pre">max_file_size</span></code> 设置为 0 并不意味着取消这个限量，而是阻止客户端创建空文件。</p>
</div>
<div class="section" id="id3">
<h2>最大文件尺寸以及性能<a class="headerlink" href="#id3" title="Permalink to this headline">¶</a></h2>
<p>在追加到文件、或设置其尺寸时， CephFS 将确保不会超过最大文件尺寸限量；但不会影响（数据）是怎样存储的。</p>
<p>有用户创建了一个硕大的文件时（未必要写入什么数据），某些操作（像删除）会让 MDS 不得不做大量操作，去检查此文件的尺寸范围内是否有本应存在（据文件尺寸计算出的）、实际上却不存在的 RADOS 对象。</p>
<p><code class="docutils literal notranslate"><span class="pre">max_file_size</span></code> 选项可防止用户创建巨型文件，如 EB 级的文件，导致在遇到类似查询状态或删除操作时产生无谓的 MDS 负载。</p>
</div>
<div class="section" id="id4">
<h2>关闭集群<a class="headerlink" href="#id4" title="Permalink to this headline">¶</a></h2>
<p>关闭一个 CephFS 集群需要设置 down 标志：</p>
<div class="highlight-default notranslate"><div class="highlight"><pre><span></span><span class="n">fs</span> <span class="nb">set</span> <span class="o">&lt;</span><span class="n">fs_name</span><span class="o">&gt;</span> <span class="n">down</span> <span class="n">true</span>
</pre></div>
</div>
<p>让集群重新上线：</p>
<div class="highlight-default notranslate"><div class="highlight"><pre><span></span><span class="n">fs</span> <span class="nb">set</span> <span class="o">&lt;</span><span class="n">fs_name</span><span class="o">&gt;</span> <span class="n">down</span> <span class="n">false</span>
</pre></div>
</div>
<p>This will also restore the previous value of max_mds. MDS daemons are brought
down in a way such that journals are flushed to the metadata pool and all
client I/O is stopped.</p>
</div>
<div class="section" id="id5">
<h2>快速关闭集群以进行反删除或灾难恢复<a class="headerlink" href="#id5" title="Permalink to this headline">¶</a></h2>
<p>To allow rapidly deleting a file system (for testing) or to quickly bring the
file system and MDS daemons down, use the <code class="docutils literal notranslate"><span class="pre">fs</span> <span class="pre">fail</span></code> command:</p>
<div class="highlight-default notranslate"><div class="highlight"><pre><span></span><span class="n">fs</span> <span class="n">fail</span> <span class="o">&lt;</span><span class="n">fs_name</span><span class="o">&gt;</span>
</pre></div>
</div>
<p>This command sets a file system flag to prevent standbys from
activating on the file system (the <code class="docutils literal notranslate"><span class="pre">joinable</span></code> flag).</p>
<p>This process can also be done manually by doing the following:</p>
<div class="highlight-default notranslate"><div class="highlight"><pre><span></span><span class="n">fs</span> <span class="nb">set</span> <span class="o">&lt;</span><span class="n">fs_name</span><span class="o">&gt;</span> <span class="n">joinable</span> <span class="n">false</span>
</pre></div>
</div>
<p>Then the operator can fail all of the ranks which causes the MDS daemons to
respawn as standbys. The file system will be left in a degraded state.</p>
<div class="highlight-default notranslate"><div class="highlight"><pre><span></span><span class="c1"># For all ranks, 0-N:</span>
<span class="n">mds</span> <span class="n">fail</span> <span class="o">&lt;</span><span class="n">fs_name</span><span class="o">&gt;</span><span class="p">:</span><span class="o">&lt;</span><span class="n">n</span><span class="o">&gt;</span>
</pre></div>
</div>
<p>Once all ranks are inactive, the file system may also be deleted or left in
this state for other purposes (perhaps disaster recovery).</p>
<p>To bring the cluster back up, simply set the joinable flag:</p>
<div class="highlight-default notranslate"><div class="highlight"><pre><span></span><span class="n">fs</span> <span class="nb">set</span> <span class="o">&lt;</span><span class="n">fs_name</span><span class="o">&gt;</span> <span class="n">joinable</span> <span class="n">true</span>
</pre></div>
</div>
</div>
<div class="section" id="id6">
<h2>守护进程管理<a class="headerlink" href="#id6" title="Permalink to this headline">¶</a></h2>
<p>大多数可操纵 MDS 的命令都需要一个 <code class="docutils literal notranslate"><span class="pre">&lt;role&gt;</span></code> 参数，它必须是以下三种格式之一：</p>
<div class="highlight-default notranslate"><div class="highlight"><pre><span></span><span class="o">&lt;</span><span class="n">fs_name</span><span class="o">&gt;</span><span class="p">:</span><span class="o">&lt;</span><span class="n">rank</span><span class="o">&gt;</span>
<span class="o">&lt;</span><span class="n">fs_id</span><span class="o">&gt;</span><span class="p">:</span><span class="o">&lt;</span><span class="n">rank</span><span class="o">&gt;</span>
<span class="o">&lt;</span><span class="n">rank</span><span class="o">&gt;</span>
</pre></div>
</div>
<p>可操纵 MDS 守护进程的命令：</p>
<div class="highlight-default notranslate"><div class="highlight"><pre><span></span><span class="n">mds</span> <span class="n">fail</span> <span class="o">&lt;</span><span class="n">gid</span><span class="o">/</span><span class="n">name</span><span class="o">/</span><span class="n">role</span><span class="o">&gt;</span>
</pre></div>
</div>
<p>把一个 MDS 守护进程标记为已失效。假如一个 MDS 守护进程在
<code class="docutils literal notranslate"><span class="pre">mds_beacon_grace</span></code> 秒内都没向监视器发送一条消息，这个操作就等价于集群自己的操作。如果此守护进程之前是活跃的，而且有可用的备机，用命令 <code class="docutils literal notranslate"><span class="pre">mds</span> <span class="pre">fail</span></code> 将迫使业务转移到备机。</p>
<p>如果此 MDS 守护进程事实上仍在运行，那么执行 <code class="docutils literal notranslate"><span class="pre">mds</span> <span class="pre">fail</span></code> 将使之重启；如果它之前是活跃的、并且还有可用的备机，那么这个“已失效”的守护进程回来后将作为备机。</p>
<div class="highlight-default notranslate"><div class="highlight"><pre><span></span><span class="n">tell</span> <span class="n">mds</span><span class="o">.&lt;</span><span class="n">daemon</span> <span class="n">name</span><span class="o">&gt;</span> <span class="n">command</span> <span class="o">...</span>
</pre></div>
</div>
<p>向 MDS 守护进程发出一个命令，指定 <code class="docutils literal notranslate"><span class="pre">mds.*</span></code> 可向所有守护进程发送命令。用 <code class="docutils literal notranslate"><span class="pre">ceph</span> <span class="pre">tell</span> <span class="pre">mds.*</span> <span class="pre">help</span></code> 命令获取所有可用命令。</p>
<div class="highlight-default notranslate"><div class="highlight"><pre><span></span><span class="n">mds</span> <span class="n">metadata</span> <span class="o">&lt;</span><span class="n">gid</span><span class="o">/</span><span class="n">name</span><span class="o">/</span><span class="n">role</span><span class="o">&gt;</span>
</pre></div>
</div>
<p>获取指定 MDS （监视器知道它）的元数据。</p>
<div class="highlight-default notranslate"><div class="highlight"><pre><span></span><span class="n">mds</span> <span class="n">repaired</span> <span class="o">&lt;</span><span class="n">role</span><span class="o">&gt;</span>
</pre></div>
</div>
<p>把文件系统 rank 标记为已修复。这里不像名字说明的那样，这个命令不会更改 MDS ，它操纵的是先前被标记为已损坏的文件系统 rank 。</p>
</div>
<div class="section" id="id7">
<h2>客户端必须具备的功能<a class="headerlink" href="#id7" title="Permalink to this headline">¶</a></h2>
<p>It is sometimes desirable to set features that clients must support to talk to
CephFS. Clients without those features may disrupt other clients or behave in
surprising ways. Or, you may want to require newer features to prevent older
and possibly buggy clients from connecting.</p>
<p>Commands to manipulate required client features of a file system:</p>
<div class="highlight-default notranslate"><div class="highlight"><pre><span></span><span class="n">fs</span> <span class="n">required_client_features</span> <span class="o">&lt;</span><span class="n">fs</span> <span class="n">name</span><span class="o">&gt;</span> <span class="n">add</span> <span class="n">reply_encoding</span>
<span class="n">fs</span> <span class="n">required_client_features</span> <span class="o">&lt;</span><span class="n">fs</span> <span class="n">name</span><span class="o">&gt;</span> <span class="n">rm</span> <span class="n">reply_encoding</span>
</pre></div>
</div>
<p>罗列所有的 CephFS 功能:</p>
<div class="highlight-default notranslate"><div class="highlight"><pre><span></span><span class="n">fs</span> <span class="n">feature</span> <span class="n">ls</span>
</pre></div>
</div>
<p>Clients that are missing newly added features will be evicted automatically.</p>
<p>Here are the current CephFS features and first release they came out:</p>
<table class="docutils align-default">
<colgroup>
<col style="width: 37%" />
<col style="width: 29%" />
<col style="width: 35%" />
</colgroup>
<thead>
<tr class="row-odd"><th class="head"><p>Feature</p></th>
<th class="head"><p>Ceph release</p></th>
<th class="head"><p>Upstream Kernel</p></th>
</tr>
</thead>
<tbody>
<tr class="row-even"><td><p>jewel</p></td>
<td><p>jewel</p></td>
<td><p>4.5</p></td>
</tr>
<tr class="row-odd"><td><p>kraken</p></td>
<td><p>kraken</p></td>
<td><p>4.13</p></td>
</tr>
<tr class="row-even"><td><p>luminous</p></td>
<td><p>luminous</p></td>
<td><p>4.13</p></td>
</tr>
<tr class="row-odd"><td><p>mimic</p></td>
<td><p>mimic</p></td>
<td><p>4.19</p></td>
</tr>
<tr class="row-even"><td><p>reply_encoding</p></td>
<td><p>nautilus</p></td>
<td><p>5.1</p></td>
</tr>
<tr class="row-odd"><td><p>reclaim_client</p></td>
<td><p>nautilus</p></td>
<td><p>N/A</p></td>
</tr>
<tr class="row-even"><td><p>lazy_caps_wanted</p></td>
<td><p>nautilus</p></td>
<td><p>5.1</p></td>
</tr>
<tr class="row-odd"><td><p>multi_reconnect</p></td>
<td><p>nautilus</p></td>
<td><p>5.1</p></td>
</tr>
<tr class="row-even"><td><p>deleg_ino</p></td>
<td><p>octopus</p></td>
<td><p>5.6</p></td>
</tr>
<tr class="row-odd"><td><p>metric_collect</p></td>
<td><p>pacific</p></td>
<td><p>N/A</p></td>
</tr>
<tr class="row-even"><td><p>alternate_name</p></td>
<td><p>pacific</p></td>
<td><p>PLANNED</p></td>
</tr>
</tbody>
</table>
<p>CephFS 功能描述</p>
<div class="highlight-default notranslate"><div class="highlight"><pre><span></span><span class="n">reply_encoding</span>
</pre></div>
</div>
<p>MDS encodes request reply in extensible format if client supports this feature.</p>
<div class="highlight-default notranslate"><div class="highlight"><pre><span></span><span class="n">reclaim_client</span>
</pre></div>
</div>
<p>MDS allows new client to reclaim another (dead) client’s states. This feature
is used by NFS-Ganesha.</p>
<div class="highlight-default notranslate"><div class="highlight"><pre><span></span><span class="n">lazy_caps_wanted</span>
</pre></div>
</div>
<p>When a stale client resumes, if the client supports this feature, mds only needs
to re-issue caps that are explictly wanted.</p>
<div class="highlight-default notranslate"><div class="highlight"><pre><span></span><span class="n">multi_reconnect</span>
</pre></div>
</div>
<p>When mds failover, client sends reconnect messages to mds, to reestablish cache
states. If MDS supports this feature, client can split large reconnect message
into multiple ones.</p>
<div class="highlight-default notranslate"><div class="highlight"><pre><span></span><span class="n">deleg_ino</span>
</pre></div>
</div>
<p>MDS delegate inode numbers to client if client supports this feature. Having
delegated inode numbers is a prerequisite for client to do async file creation.</p>
<div class="highlight-default notranslate"><div class="highlight"><pre><span></span><span class="n">metric_collect</span>
</pre></div>
</div>
<p>如果 MDS 支持性能指标功能，客户端可以发给它。</p>
<div class="highlight-default notranslate"><div class="highlight"><pre><span></span><span class="n">alternate_name</span>
</pre></div>
</div>
<p>客户端可以设置并理解目录的“别名（ alternate names ）”。
此功能用于支持加密的文件名。</p>
</div>
<div class="section" id="id8">
<h2>全局配置选项<a class="headerlink" href="#id8" title="Permalink to this headline">¶</a></h2>
<div class="highlight-default notranslate"><div class="highlight"><pre><span></span><span class="n">fs</span> <span class="n">flag</span> <span class="nb">set</span> <span class="o">&lt;</span><span class="n">flag</span> <span class="n">name</span><span class="o">&gt;</span> <span class="o">&lt;</span><span class="n">flag</span> <span class="n">val</span><span class="o">&gt;</span> <span class="p">[</span><span class="o">&lt;</span><span class="n">confirmation</span> <span class="n">string</span><span class="o">&gt;</span><span class="p">]</span>
</pre></div>
</div>
<p>设置全局的 CephFS 标记（即不是特定于某个文件系统的）。当前，仅有的标记是 enable_multiple ，启用它就可以支持多个 CephFS
文件系统。</p>
<p>有些标志会强迫你用 <code class="docutils literal notranslate"><span class="pre">--yes-i-really-mean-it</span></code> 或者类似的语句（执行时会提示）来确认你的意图。运行这类命令时要三思而后行，它们通常用于提示非常危险的动作。</p>
</div>
<div class="section" id="advanced-cephfs-admin-settings">
<span id="id9"></span><h2>高级选项<a class="headerlink" href="#advanced-cephfs-admin-settings" title="Permalink to this headline">¶</a></h2>
<p>以下这些命令在常规操作中用不到，在遇到异常时才需要。
这些命令若使用不当会产生严重问题，
甚至会导致文件系统无法访问。</p>
<div class="highlight-default notranslate"><div class="highlight"><pre><span></span><span class="n">mds</span> <span class="n">rmfailed</span>
</pre></div>
</div>
<p>从失效集合中删除一个 rank 。</p>
<div class="highlight-default notranslate"><div class="highlight"><pre><span></span><span class="n">fs</span> <span class="n">reset</span> <span class="o">&lt;</span><span class="n">file</span> <span class="n">system</span> <span class="n">name</span><span class="o">&gt;</span>
</pre></div>
</div>
<p>此命令可把文件系统状态（除名字和存储池以外的）重置为默认值。所有非 0 rank 都会保存在停止集里面。</p>
<div class="highlight-default notranslate"><div class="highlight"><pre><span></span><span class="n">fs</span> <span class="n">new</span> <span class="o">&lt;</span><span class="n">file</span> <span class="n">system</span> <span class="n">name</span><span class="o">&gt;</span> <span class="o">&lt;</span><span class="n">metadata</span> <span class="n">pool</span> <span class="n">name</span><span class="o">&gt;</span> <span class="o">&lt;</span><span class="n">data</span> <span class="n">pool</span> <span class="n">name</span><span class="o">&gt;</span> <span class="o">--</span><span class="n">fscid</span> <span class="o">&lt;</span><span class="n">fscid</span><span class="o">&gt;</span> <span class="o">--</span><span class="n">force</span>
</pre></div>
</div>
<p>This command creates a file system with a specific <strong>fscid</strong> (file system cluster ID).
You may want to do this when an application expects the file system’s ID to be
stable after it has been recovered, e.g., after monitor databases are lost and
rebuilt. Consequently, file system IDs don’t always keep increasing with newer
file systems.</p>
</div>
</div>



           </div>
           
          </div>
          <footer>
    <div class="rst-footer-buttons" role="navigation" aria-label="footer navigation">
        <a href="../multifs/" class="btn btn-neutral float-right" title="Multiple Ceph File Systems" accesskey="n" rel="next">Next <span class="fa fa-arrow-circle-right" aria-hidden="true"></span></a>
        <a href="../createfs/" class="btn btn-neutral float-left" title="创建 Ceph 文件系统" accesskey="p" rel="prev"><span class="fa fa-arrow-circle-left" aria-hidden="true"></span> Previous</a>
    </div>

  <hr/>

  <div role="contentinfo">
    <p>
        &#169; Copyright 2016, Ceph authors and contributors. Licensed under Creative Commons Attribution Share Alike 3.0 (CC-BY-SA-3.0).

    </p>
  </div> 

</footer>
        </div>
      </div>

    </section>

  </div>
  

  <script type="text/javascript">
      jQuery(function () {
          SphinxRtdTheme.Navigation.enable(true);
      });
  </script>

  
  
    
   

</body>
</html>